package com.example.qxfw.common.service.impl;


import com.example.qxfw.common.entity.zy.EnviroStation;
import com.example.qxfw.common.mapper.EnvirostationMapperXml;
import com.example.qxfw.common.service.EnviroStationServicePro;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/************************************
 *
 * @author : HuangDeYin Jolly
 * @since : JDK 11
 * @Date : 2023/7/8  星期六   16:04
 * @description : 此类用来
 ***************************************/
@Service
public class EnviroStationServiceProImpl implements EnviroStationServicePro {

    @Autowired
    private EnvirostationMapperXml envirostationMapperXml;

    @Override
    public Integer save(final List<EnviroStation> dataList) {
        List<Integer> result = new ArrayList<>();
        dataList.forEach(envirostation -> {
            int insertSelective = this.envirostationMapperXml.insertSelective(envirostation);
            result.add(insertSelective);
        });
        if (result.contains(0)) {
            return 0;
        } else {
            return 1;
        }
    }
}
